﻿<!--#include file="inc/common.asp" -->

<%
    call openDB
    dim title, user_name

    sql = " select top 5 a.content_id,  a.title,  a.insert_time, a.user_name,b.blog_id, b.blog_title from blog_content a, blog b where a.blog_id=b.blog_id and a.is_secret=false order by a.insert_time desc"
    rs.open sql,conn,1,1
    
%>
document.write("<H2>最新文章</H2><UL>");
<%
    do until rs.eof       
        title = rs("title")
        if strlen(title)>24 then
            title = strleft(title,22) & ".."
        end if
        user_name = rs("user_name")
        if strlen(user_name)>24 then
            user_name = strleft(user_name,22) & ".."
        end if
%>
document.write('<LI>'
    +'<a href="<%=baseURL%>/detail.asp?blog_id=<%=rs("blog_id")%>&content_id=<%=rs("content_id")%>#top" ><%=title%></a>'
    +'<br> -- <%=user_name%>'
    +'</LI>');
<%  
        rs.moveNext()
    loop
%>

document.write("</UL>");

////////////////////////////////////////////////////////////////


<%
    rs.close()
    
    sql = " select top 10 b.blog_id, a.comment_id, b.title, a.content_id,  a.insert_time, a.user_name from blog_comments a, blog_content b  where a.content_id = b.content_id  and b.is_secret=false and a.is_secret=false order by a.insert_time desc "
    rs.open sql,conn,1,1
    
%>
document.write("<H2>最新回复</H2><UL>");
<%
    do until rs.eof       
        title = rs("title")
        if strlen(title)>24 then
            title = strleft(title,22) & ".."
        end if
        user_name = rs("user_name")
        if strlen(user_name)>24 then
            title = strleft(user_name,22) & ".."
        end if
%>
document.write('<LI>'
    +'<a href="<%=baseURL%>/detail.asp?blog_id=<%=rs("blog_id")%>&content_id=<%=rs("content_id")%>#comment<%=rs("comment_id")%>" ><%=title%></a>'
    +'<br> -- <%=user_name%>'
    +'</LI>');
<%  
        rs.moveNext()
    loop
%>

document.write("</UL>");

<%

  
  rs.close()
  set rs = nothing
    
  conn.close()
  set conn=nothing
%>

<!--#include file="inc/end.asp" -->